package com.zksw.constant;

import com.zksw.utils.StringUtils;

/**
 * 分销提现常量
 *
 * @author mok
 */
public class DistributionWithdrawConstant {

	/**
	 * 提现状态
	 */
	public enum WithdrawStatus {

		HAS_APPLYED(0, "已申请"), HAS_PAYED(1, "已付款"), HAS_REJECTED(2, "驳回");

		private Integer value;

		private String name;

		private WithdrawStatus(Integer value, String name) {
			this.value = value;
			this.name = name;
		}

		public Integer getValue() {
			return value;
		}

		public void setValue(Integer value) {
			this.value = value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public static String getNameByValue(Integer value) {

			if (StringUtils.isNullOrEmpty(value)) {
				return "";
			}

			for (WithdrawStatus withdrawStatus : WithdrawStatus.values()) {
				if (withdrawStatus.value.equals(value)) {
					return withdrawStatus.name;
				}
			}

			return "";
		}
	}

	/**
	 * 付款方式
	 */
	public enum PayType {

		WECHAT_PAY(1, "微信支付"), ALI_PAY(2, "支付宝支付"), UNION_PAY(3, "银行卡转账");

		private Integer value;

		private String name;

		private PayType(Integer value, String name) {
			this.value = value;
			this.name = name;
		}

		public Integer getValue() {
			return value;
		}

		public void setValue(Integer value) {
			this.value = value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public static String getNameByValue(Integer value) {

			if (StringUtils.isNullOrEmpty(value)) {
				return "";
			}

			for (PayType payType : PayType.values()) {
				if (payType.value.equals(value)) {
					return payType.name;
				}
			}

			return "";
		}
	}

	/**
	 * 资金类型
	 */
	public enum MoneyType {

		COMMISSION(0, "佣金"), BONUS(2, "奖金");

		private Integer value;

		private String name;

		private MoneyType(Integer value, String name) {
			this.value = value;
			this.name = name;
		}

		public Integer getValue() {
			return value;
		}

		public void setValue(Integer value) {
			this.value = value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public static String getNameByValue(Integer value) {

			if (StringUtils.isNullOrEmpty(value)) {
				return "";
			}

			for (MoneyType moneyType : MoneyType.values()) {
				if (moneyType.value.equals(value)) {
					return moneyType.name;
				}
			}

			return "";
		}
	}
}
